import { http } from '@/http/http'

// 密码登录
export interface loginpass {
  password: string
  mobile: string
}
export interface getloginpass {
  code: number
  message: string
  token: string
  data: {
    token: string
    refreshToken: string
    avatar: string
    mobile: string
    account: string
    id: string
  }
}
// 获取验证码
export interface loginy {
  type: string
  mobile: string
}
export interface getloginy {
  code: number
  message: string
  data: {
    code: string
  }
}
// 验证码登录
export interface loginym {
  code: string
  mobile: string
}
export interface gerloginym {
  code: number
  message: string
  data: {
    token: string
    refreshToken: string
    avatar: string
    mobile: string
    account: string
    id: string
  }
}

// 密码登录
export function getLoginPass(data: loginpass) {
  return http.post<getloginpass>('/login/password', data)
}
// 获取手机验证码
export function getLoginY(data: loginy) {
  return http.get<getloginy>('/code', data)
}
// 验证码登录
export function getLoginYM(data: loginym) {
  return http.post<gerloginym>('/login', data)
}
